package com.moyuwanjia.Dao;

import com.moyuwanjia.Vo.QueryVo;
import com.moyuwanjia.domain.User;
import org.apache.ibatis.session.SqlSession;
import org.apache.ibatis.session.SqlSessionFactory;

import java.util.List;

/**
 * @author 摸鱼丸加~
 * @create 2022-03-30 22:13
 * 测试使用实现类的方式实现查询
 */
public class UserDaoImpl implements IUserDao
{
    private SqlSessionFactory factory;
    public UserDaoImpl(SqlSessionFactory factory){
        this.factory = factory;
    }
    @Override
    public List<User> findAll() {
        //1.使用工厂创建SqlSession对象
        SqlSession session = factory.openSession();
        //2.使用session执行查询
        List<User> list = session.selectList("com.moyuwanjia.Dao.IUserDao.findAll");
        //4.关闭资源
        session.close();
        return list;
    }

    @Override
    public List<User> findAll02() {
        return null;
    }

    @Override
    public int FindTotal() {
        return 0;
    }

    @Override
    public List<User> FindTotal1(QueryVo queryVo) {
        return null;
    }

    @Override
    public List<User> annotation_FindAll() {
        return null;
    }

    @Override
    public User annotation_FindOne(Integer id) {
        return null;
    }

    @Override
    public Integer annotation_Save(User user) {
        return null;
    }

    @Override
    public Integer annotation_Update(User user) {
        return null;
    }

    @Override
    public Integer annotation_Delete(Integer id) {
        return null;
    }
}
